<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:og="http://ogp.me/ns#"
	  xmlns:fb="http://ogp.me/ns/fb#"
	  itemscope itemtype="http://schema.org/Article"
	  <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
    <title><?php
        if ( is_single() ) { single_post_title(); print ' | Sfaturi utile despre '; print strtolower(single_post_title('', false)); }
        elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); }
        elseif ( is_page() ) { single_post_title(''); }
        elseif ( is_search() ) { bloginfo('name'); print ' | Rezultate dupa ' . wp_specialchars($s); get_page_number(); }
        elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; }
        else { bloginfo('name'); wp_title('|'); get_page_number(); }
    ?></title>
	<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />	
	<meta http-equiv="X-UA-Compatible" content="IE=9" />
	
	<?php 
	if (is_page() != 1 && is_category() != 1 && is_search() != 1)
	{
		$socArticleImg = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'large');
		$gglIndefiniteArticle = indefinite_article(get_the_id());
		$socialArticleTitle = get_the_title();
		echo '<meta content="Afla ce trebuie sa stii si care sunt lucrurile care conteaza cu adevarat cand cumperi '.$gglIndefiniteArticle.' '.strtolower($socialArticleTitle).'!" name="description" />
			  <meta property="og:title" content="'.$socialArticleTitle.'" />
			  <meta property="og:type" content="article" />
			  <meta property="og:url" content="'.get_permalink().'" />
			  <meta property="og:image" content="'.$socArticleImg[0].'" />
			  <meta property="og:description" content="Afla ce trebuie sa stii si care sunt lucrurile care conteaza cand cumperi '.$gglIndefiniteArticle.' '.strtolower($socialArticleTitle).'!"/>
			  <meta itemprop="name" content="'.$socialArticleTitle.'" />
			  <meta itemprop="description" content="Afla ce trebuie sa stii si care sunt lucrurile care conteaza cand cumperi '.$gglIndefiniteArticle.' '.strtolower($socialArticleTitle).'!" />
			  <meta itemprop="image" content="'.$socArticleImg[0].'" />';
	}
	else{
		echo '<meta content="'.get_option("esf_site_description").'" name="description" />
			  <meta property="og:title" content="eSfaturi" />
			  <meta property="og:type" content="website" />
			  <meta property="og:url" content="'.get_bloginfo('url').'" />
			  <meta property="og:image" content="http://www.esfaturi.ro/wp-content/uploads/2012/03/logo-250x250-transparent.png" />
			  <meta property="og:description" content="'.get_option("esf_site_description").'"/>
			  <meta itemprop="name" content="eSfaturi" />
			  <meta itemprop="description" content="Afla ce trebuie sa stii si care sunt lucrurile care conteaza cand cumperi un produs electrocasnic, electronic sau IT!" />
			  <meta itemprop="image" content="http://www.esfaturi.ro/wp-content/uploads/2012/03/logo-250x250-transparent.png" />';
	}
	?>
	<meta property="og:site_name" content="<?php echo get_bloginfo('name'); ?>" />
	<meta property="fb:admins" content="100003058176638,780167493" />
	<link rel="icon" type="image/png" href="<?php echo get_template_directory_uri(); ?>/styles/images/favicon.png" />
	<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
	
	<?php wp_enqueue_script("jquery", get_bloginfo('wpurl').'/wp-includes/js/jquery/jquery.js'); ?>
	<?php 
		if(is_home() || is_front_page())
			wp_enqueue_script('slideshow', get_template_directory_uri().'/js/slideshow.js', array('jquery'), '1.0.0' );
		if (is_page('contact'))
			wp_enqueue_script('contact', get_template_directory_uri().'/js/contact.js', array('jquery'), '1.0.0' );
		// add fancybox on article pages
		if ( is_single() || is_page("Contact") ) {
			wp_enqueue_script('fancybox', get_template_directory_uri().'/js/fancybox/fancybox-1.3.4.pack.js', array('jquery'), '1.3.4' );
			echo '<link rel="stylesheet" href="'.get_template_directory_uri().'/js/fancybox/fancybox-1.3.4.css" type="text/css" media="screen" />';
		}	
		wp_enqueue_script('watermark', get_template_directory_uri().'/js/jquery.watermark.min.js', array('jquery'), '3.1.3' );
		wp_enqueue_script('esfaturi', get_template_directory_uri().'/js/esfaturi.js', array('jquery'), '1.0.0' );
	?>
	
	<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>" title="<?php printf( __( '%s.ro ultimele sfaturi din electronice, electrocasnice si IT', 'shape' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
	<script type="text/javascript">
	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-29864589-1']);
	  _gaq.push(['_trackPageview']);

	  (function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();
	</script>
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<div id="fb-root"></div>
<script type="text/javascript">(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<?php 
// Add twitter and google plus scripts needed for social buttons
if ( is_single() || is_page("Contact") ) : ?>
<script type="text/javascript">
	window.___gcfg = {lang: 'ro'};
	(function() {
		var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
		po.src = 'https://apis.google.com/js/plusone.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
	})();
</script>
<script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<?php endif; ?>
<a name="wrapper"></a>
<div id="wrapper" class="hfeed">

	<div id="header">
		<div id="masthead">
		
			<div id="branding">
				<div id="blog-title">
					<a href="<?php bloginfo( 'url' ) ?>/" title="<?php bloginfo( 'name' ) ?>" rel="home">
						<img src="<?php echo get_template_directory_uri().'/styles/images/logo-esfaturi-170x56.png' ?>" alt="eSfaturi.ro" />
					</a>
				</div>
<?php if ( is_home() || is_front_page() ) { ?>
		    		<h1 id="blog-description"><?php bloginfo( 'description' ) ?></h1>
<?php } else { ?>	
		    		<div id="blog-description"><?php bloginfo( 'description' ) ?></div>
<?php } ?>
			</div><!-- #branding -->
			
			<div id="access">
				<?php wp_page_menu( 'sort_column=menu_order&exclude=14,203,205,207,209' ); ?>
			</div><!-- #access -->
			<div id="access-search">
				<?php get_search_form(); ?>
			</div><!-- #search form -->
			
		</div><!-- #masthead -->	
	</div><!-- #header -->
	
	<div id="main">